\(\int \frac {\tan ^2(x)}{\sqrt {a+b \tan ^4(x)}} \, dx\) [399]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [C] (verified)
   Fricas [F]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 17, antiderivative size = 291 \[ \int \frac {\tan ^2(x)}{\sqrt {a+b \tan ^4(x)}} \, dx=-\frac {\arctan \left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a+b \tan ^4(x)}}\right )}{2 \sqrt {a+b}}+\frac {\sqrt [4]{a} \operatorname {EllipticF}\left (2 \arctan \left (\frac {\sqrt [4]{b} \tan (x)}{\sqrt [4]{a}}\right ),\frac {1}{2}\right ) \left (\sqrt {a}+\sqrt {b} \tan ^2(x)\right ) \sqrt {\frac {a+b \tan ^4(x)}{\left (\sqrt {a}+\sqrt {b} \tan ^2(x)\right )^2}}}{2 \left (\sqrt {a}-\sqrt {b}\right ) \sqrt [4]{b} \sqrt {a+b \tan ^4(x)}}-\frac {\left (\sqrt {a}+\sqrt {b}\right ) \operatorname {EllipticPi}\left (-\frac {\left (\sqrt {a}-\sqrt {b}\right )^2}{4 \sqrt {a} \sqrt {b}},2 \arctan \left (\frac {\sqrt [4]{b} \tan (x)}{\sqrt [4]{a}}\right ),\frac {1}{2}\right ) \left (\sqrt {a}+\sqrt {b} \tan ^2(x)\right ) \sqrt {\frac {a+b \tan ^4(x)}{\left (\sqrt {a}+\sqrt {b} \tan ^2(x)\right )^2}}}{4 \sqrt [4]{a} \left (\sqrt {a}-\sqrt {b}\right ) \sqrt [4]{b} \sqrt {a+b \tan ^4(x)}} \]

[Out]

-1/2*arctan((a+b)^(1/2)*tan(x)/(a+b*tan(x)^4)^(1/2))/(a+b)^(1/2)+1/2*a^(1/4)*(cos(2*arctan(b^(1/4)*tan(x)/a^(1
/4)))^2)^(1/2)/cos(2*arctan(b^(1/4)*tan(x)/a^(1/4)))*EllipticF(sin(2*arctan(b^(1/4)*tan(x)/a^(1/4))),1/2*2^(1/
2))*((a+b*tan(x)^4)/(a^(1/2)+b^(1/2)*tan(x)^2)^2)^(1/2)*(a^(1/2)+b^(1/2)*tan(x)^2)/b^(1/4)/(a^(1/2)-b^(1/2))/(
a+b*tan(x)^4)^(1/2)-1/4*(cos(2*arctan(b^(1/4)*tan(x)/a^(1/4)))^2)^(1/2)/cos(2*arctan(b^(1/4)*tan(x)/a^(1/4)))*
EllipticPi(sin(2*arctan(b^(1/4)*tan(x)/a^(1/4))),-1/4*(a^(1/2)-b^(1/2))^2/a^(1/2)/b^(1/2),1/2*2^(1/2))*(a^(1/2
)+b^(1/2))*((a+b*tan(x)^4)/(a^(1/2)+b^(1/2)*tan(x)^2)^2)^(1/2)*(a^(1/2)+b^(1/2)*tan(x)^2)/a^(1/4)/b^(1/4)/(a^(
1/2)-b^(1/2))/(a+b*tan(x)^4)^(1/2)

Rubi [A] (verified)

Time = 0.26 (sec) , antiderivative size = 291, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {3751, 1334, 226, 1721} \[ \int \frac {\tan ^2(x)}{\sqrt {a+b \tan ^4(x)}} \, dx=-\frac {\arctan \left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a+b \tan ^4(x)}}\right )}{2 \sqrt {a+b}}+\frac {\sqrt [4]{a} \left (\sqrt {a}+\sqrt {b} \tan ^2(x)\right ) \sqrt {\frac {a+b \tan ^4(x)}{\left (\sqrt {a}+\sqrt {b} \tan ^2(x)\right )^2}} \operatorname {EllipticF}\left (2 \arctan \left (\frac {\sqrt [4]{b} \tan (x)}{\sqrt [4]{a}}\right ),\frac {1}{2}\right )}{2 \sqrt [4]{b} \left (\sqrt {a}-\sqrt {b}\right ) \sqrt {a+b \tan ^4(x)}}-\frac {\left (\sqrt {a}+\sqrt {b}\right ) \left (\sqrt {a}+\sqrt {b} \tan ^2(x)\right ) \sqrt {\frac {a+b \tan ^4(x)}{\left (\sqrt {a}+\sqrt {b} \tan ^2(x)\right )^2}} \operatorname {EllipticPi}\left (-\frac {\left (\sqrt {a}-\sqrt {b}\right )^2}{4 \sqrt {a} \sqrt {b}},2 \arctan \left (\frac {\sqrt [4]{b} \tan (x)}{\sqrt [4]{a}}\right ),\frac {1}{2}\right )}{4 \sqrt [4]{a} \sqrt [4]{b} \left (\sqrt {a}-\sqrt {b}\right ) \sqrt {a+b \tan ^4(x)}} \]

[In]

Int[Tan[x]^2/Sqrt[a + b*Tan[x]^4],x]

[Out]

-1/2*ArcTan[(Sqrt[a + b]*Tan[x])/Sqrt[a + b*Tan[x]^4]]/Sqrt[a + b] + (a^(1/4)*EllipticF[2*ArcTan[(b^(1/4)*Tan[
x])/a^(1/4)], 1/2]*(Sqrt[a] + Sqrt[b]*Tan[x]^2)*Sqrt[(a + b*Tan[x]^4)/(Sqrt[a] + Sqrt[b]*Tan[x]^2)^2])/(2*(Sqr
t[a] - Sqrt[b])*b^(1/4)*Sqrt[a + b*Tan[x]^4]) - ((Sqrt[a] + Sqrt[b])*EllipticPi[-1/4*(Sqrt[a] - Sqrt[b])^2/(Sq
rt[a]*Sqrt[b]), 2*ArcTan[(b^(1/4)*Tan[x])/a^(1/4)], 1/2]*(Sqrt[a] + Sqrt[b]*Tan[x]^2)*Sqrt[(a + b*Tan[x]^4)/(S
qrt[a] + Sqrt[b]*Tan[x]^2)^2])/(4*a^(1/4)*(Sqrt[a] - Sqrt[b])*b^(1/4)*Sqrt[a + b*Tan[x]^4])

Rule 226

Int[1/Sqrt[(a_) + (b_.)*(x_)^4], x_Symbol] :> With[{q = Rt[b/a, 4]}, Simp[(1 + q^2*x^2)*(Sqrt[(a + b*x^4)/(a*(
1 + q^2*x^2)^2)]/(2*q*Sqrt[a + b*x^4]))*EllipticF[2*ArcTan[q*x], 1/2], x]] /; FreeQ[{a, b}, x] && PosQ[b/a]

Rule 1334

Int[(x_)^2/(((d_) + (e_.)*(x_)^2)*Sqrt[(a_) + (c_.)*(x_)^4]), x_Symbol] :> With[{q = Rt[c/a, 2]}, Dist[(-a)*((
e + d*q)/(c*d^2 - a*e^2)), Int[1/Sqrt[a + c*x^4], x], x] + Dist[a*d*((e + d*q)/(c*d^2 - a*e^2)), Int[(1 + q*x^
2)/((d + e*x^2)*Sqrt[a + c*x^4]), x], x]] /; FreeQ[{a, c, d, e}, x] && NeQ[c*d^2 + a*e^2, 0] && PosQ[c/a] && N
eQ[c*d^2 - a*e^2, 0]

Rule 1721

Int[((A_) + (B_.)*(x_)^2)/(((d_) + (e_.)*(x_)^2)*Sqrt[(a_) + (c_.)*(x_)^4]), x_Symbol] :> With[{q = Rt[B/A, 2]
}, Simp[(-(B*d - A*e))*(ArcTan[Rt[c*(d/e) + a*(e/d), 2]*(x/Sqrt[a + c*x^4])]/(2*d*e*Rt[c*(d/e) + a*(e/d), 2]))
, x] + Simp[(B*d + A*e)*(A + B*x^2)*(Sqrt[A^2*((a + c*x^4)/(a*(A + B*x^2)^2))]/(4*d*e*A*q*Sqrt[a + c*x^4]))*El
lipticPi[Cancel[-(B*d - A*e)^2/(4*d*e*A*B)], 2*ArcTan[q*x], 1/2], x]] /; FreeQ[{a, c, d, e, A, B}, x] && NeQ[c
*d^2 + a*e^2, 0] && NeQ[c*d^2 - a*e^2, 0] && PosQ[c/a] && EqQ[c*A^2 - a*B^2, 0]

Rule 3751

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[c*(ff/f), Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2
 + ff^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {x^2}{\left (1+x^2\right ) \sqrt {a+b x^4}} \, dx,x,\tan (x)\right ) \\ & = \frac {\sqrt {a} \text {Subst}\left (\int \frac {1}{\sqrt {a+b x^4}} \, dx,x,\tan (x)\right )}{\sqrt {a}-\sqrt {b}}-\frac {\sqrt {a} \text {Subst}\left (\int \frac {1+\frac {\sqrt {b} x^2}{\sqrt {a}}}{\left (1+x^2\right ) \sqrt {a+b x^4}} \, dx,x,\tan (x)\right )}{\sqrt {a}-\sqrt {b}} \\ & = -\frac {\arctan \left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a+b \tan ^4(x)}}\right )}{2 \sqrt {a+b}}+\frac {\sqrt [4]{a} \operatorname {EllipticF}\left (2 \arctan \left (\frac {\sqrt [4]{b} \tan (x)}{\sqrt [4]{a}}\right ),\frac {1}{2}\right ) \left (\sqrt {a}+\sqrt {b} \tan ^2(x)\right ) \sqrt {\frac {a+b \tan ^4(x)}{\left (\sqrt {a}+\sqrt {b} \tan ^2(x)\right )^2}}}{2 \left (\sqrt {a}-\sqrt {b}\right ) \sqrt [4]{b} \sqrt {a+b \tan ^4(x)}}-\frac {\left (\sqrt {a}+\sqrt {b}\right ) \operatorname {EllipticPi}\left (-\frac {\left (\sqrt {a}-\sqrt {b}\right )^2}{4 \sqrt {a} \sqrt {b}},2 \arctan \left (\frac {\sqrt [4]{b} \tan (x)}{\sqrt [4]{a}}\right ),\frac {1}{2}\right ) \left (\sqrt {a}+\sqrt {b} \tan ^2(x)\right ) \sqrt {\frac {a+b \tan ^4(x)}{\left (\sqrt {a}+\sqrt {b} \tan ^2(x)\right )^2}}}{4 \sqrt [4]{a} \left (\sqrt {a}-\sqrt {b}\right ) \sqrt [4]{b} \sqrt {a+b \tan ^4(x)}} \\ \end{align*}

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 1.82 (sec) , antiderivative size = 122, normalized size of antiderivative = 0.42 \[ \int \frac {\tan ^2(x)}{\sqrt {a+b \tan ^4(x)}} \, dx=-\frac {i \left (\operatorname {EllipticF}\left (i \text {arcsinh}\left (\sqrt {\frac {i \sqrt {b}}{\sqrt {a}}} \tan (x)\right ),-1\right )-\operatorname {EllipticPi}\left (-\frac {i \sqrt {a}}{\sqrt {b}},i \text {arcsinh}\left (\sqrt {\frac {i \sqrt {b}}{\sqrt {a}}} \tan (x)\right ),-1\right )\right ) \sqrt {1+\frac {b \tan ^4(x)}{a}}}{\sqrt {\frac {i \sqrt {b}}{\sqrt {a}}} \sqrt {a+b \tan ^4(x)}} \]

[In]

Integrate[Tan[x]^2/Sqrt[a + b*Tan[x]^4],x]

[Out]

((-I)*(EllipticF[I*ArcSinh[Sqrt[(I*Sqrt[b])/Sqrt[a]]*Tan[x]], -1] - EllipticPi[((-I)*Sqrt[a])/Sqrt[b], I*ArcSi
nh[Sqrt[(I*Sqrt[b])/Sqrt[a]]*Tan[x]], -1])*Sqrt[1 + (b*Tan[x]^4)/a])/(Sqrt[(I*Sqrt[b])/Sqrt[a]]*Sqrt[a + b*Tan
[x]^4])

Maple [C] (verified)

Result contains complex when optimal does not.

Time = 0.62 (sec) , antiderivative size = 179, normalized size of antiderivative = 0.62

method result size
derivativedivides \(\frac {\sqrt {1-\frac {i \sqrt {b}\, \tan \left (x \right )^{2}}{\sqrt {a}}}\, \sqrt {1+\frac {i \sqrt {b}\, \tan \left (x \right )^{2}}{\sqrt {a}}}\, \operatorname {EllipticF}\left (\tan \left (x \right ) \sqrt {\frac {i \sqrt {b}}{\sqrt {a}}}, i\right )}{\sqrt {\frac {i \sqrt {b}}{\sqrt {a}}}\, \sqrt {a +b \tan \left (x \right )^{4}}}-\frac {\sqrt {1-\frac {i \sqrt {b}\, \tan \left (x \right )^{2}}{\sqrt {a}}}\, \sqrt {1+\frac {i \sqrt {b}\, \tan \left (x \right )^{2}}{\sqrt {a}}}\, \operatorname {EllipticPi}\left (\tan \left (x \right ) \sqrt {\frac {i \sqrt {b}}{\sqrt {a}}}, \frac {i \sqrt {a}}{\sqrt {b}}, \frac {\sqrt {-\frac {i \sqrt {b}}{\sqrt {a}}}}{\sqrt {\frac {i \sqrt {b}}{\sqrt {a}}}}\right )}{\sqrt {\frac {i \sqrt {b}}{\sqrt {a}}}\, \sqrt {a +b \tan \left (x \right )^{4}}}\) \(179\)
default \(\frac {\sqrt {1-\frac {i \sqrt {b}\, \tan \left (x \right )^{2}}{\sqrt {a}}}\, \sqrt {1+\frac {i \sqrt {b}\, \tan \left (x \right )^{2}}{\sqrt {a}}}\, \operatorname {EllipticF}\left (\tan \left (x \right ) \sqrt {\frac {i \sqrt {b}}{\sqrt {a}}}, i\right )}{\sqrt {\frac {i \sqrt {b}}{\sqrt {a}}}\, \sqrt {a +b \tan \left (x \right )^{4}}}-\frac {\sqrt {1-\frac {i \sqrt {b}\, \tan \left (x \right )^{2}}{\sqrt {a}}}\, \sqrt {1+\frac {i \sqrt {b}\, \tan \left (x \right )^{2}}{\sqrt {a}}}\, \operatorname {EllipticPi}\left (\tan \left (x \right ) \sqrt {\frac {i \sqrt {b}}{\sqrt {a}}}, \frac {i \sqrt {a}}{\sqrt {b}}, \frac {\sqrt {-\frac {i \sqrt {b}}{\sqrt {a}}}}{\sqrt {\frac {i \sqrt {b}}{\sqrt {a}}}}\right )}{\sqrt {\frac {i \sqrt {b}}{\sqrt {a}}}\, \sqrt {a +b \tan \left (x \right )^{4}}}\) \(179\)

[In]

int(tan(x)^2/(a+b*tan(x)^4)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/(I/a^(1/2)*b^(1/2))^(1/2)*(1-I/a^(1/2)*b^(1/2)*tan(x)^2)^(1/2)*(1+I/a^(1/2)*b^(1/2)*tan(x)^2)^(1/2)/(a+b*tan
(x)^4)^(1/2)*EllipticF(tan(x)*(I/a^(1/2)*b^(1/2))^(1/2),I)-1/(I/a^(1/2)*b^(1/2))^(1/2)*(1-I/a^(1/2)*b^(1/2)*ta
n(x)^2)^(1/2)*(1+I/a^(1/2)*b^(1/2)*tan(x)^2)^(1/2)/(a+b*tan(x)^4)^(1/2)*EllipticPi(tan(x)*(I/a^(1/2)*b^(1/2))^
(1/2),I*a^(1/2)/b^(1/2),(-I/a^(1/2)*b^(1/2))^(1/2)/(I/a^(1/2)*b^(1/2))^(1/2))

Fricas [F]

\[ \int \frac {\tan ^2(x)}{\sqrt {a+b \tan ^4(x)}} \, dx=\int { \frac {\tan \left (x\right )^{2}}{\sqrt {b \tan \left (x\right )^{4} + a}} \,d x } \]

[In]

integrate(tan(x)^2/(a+b*tan(x)^4)^(1/2),x, algorithm="fricas")

[Out]

integral(tan(x)^2/sqrt(b*tan(x)^4 + a), x)

Sympy [F]

\[ \int \frac {\tan ^2(x)}{\sqrt {a+b \tan ^4(x)}} \, dx=\int \frac {\tan ^{2}{\left (x \right )}}{\sqrt {a + b \tan ^{4}{\left (x \right )}}}\, dx \]

[In]

integrate(tan(x)**2/(a+b*tan(x)**4)**(1/2),x)

[Out]

Integral(tan(x)**2/sqrt(a + b*tan(x)**4), x)

Maxima [F]

\[ \int \frac {\tan ^2(x)}{\sqrt {a+b \tan ^4(x)}} \, dx=\int { \frac {\tan \left (x\right )^{2}}{\sqrt {b \tan \left (x\right )^{4} + a}} \,d x } \]

[In]

integrate(tan(x)^2/(a+b*tan(x)^4)^(1/2),x, algorithm="maxima")

[Out]

integrate(tan(x)^2/sqrt(b*tan(x)^4 + a), x)

Giac [F]

\[ \int \frac {\tan ^2(x)}{\sqrt {a+b \tan ^4(x)}} \, dx=\int { \frac {\tan \left (x\right )^{2}}{\sqrt {b \tan \left (x\right )^{4} + a}} \,d x } \]

[In]

integrate(tan(x)^2/(a+b*tan(x)^4)^(1/2),x, algorithm="giac")

[Out]

integrate(tan(x)^2/sqrt(b*tan(x)^4 + a), x)

Mupad [F(-1)]

Timed out. \[ \int \frac {\tan ^2(x)}{\sqrt {a+b \tan ^4(x)}} \, dx=\int \frac {{\mathrm {tan}\left (x\right )}^2}{\sqrt {b\,{\mathrm {tan}\left (x\right )}^4+a}} \,d x \]

[In]

int(tan(x)^2/(a + b*tan(x)^4)^(1/2),x)

[Out]

int(tan(x)^2/(a + b*tan(x)^4)^(1/2), x)